<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('处理电话工单初稿')"/>
    <link th:href="@{/ajax/libs/bootstrap-switch/bootstrap-switch.min.css}" rel="stylesheet">
    <link th:href="@{/ajax/libs/bootstrap-tagsinput/tagsinput.css}" rel="stylesheet">
    <link th:href="@{/ajax/libs/jQuery-ui/jquery-ui.css}" rel="stylesheet">
    <link th:href="@{/css/iconfont/iconfont.css}" rel="stylesheet">
    <link rel="stylesheet" type="text/css" th:href="@{/ajax/libs/qxEasyUI/themes/default/easyui.css}">


</head>
<style>
    body .to-fix-select .layui-layer-content {overflow: visible;}
    .fixed-table-pagination > .pull-left {
        display: none;
    }

    .bootstrap-tagsinput > input {
        display: none;
    }

    .tworkformprocess-gjz {
        display: inline-block;
        background-color: #FAFAFA;
        padding: 3px;
        border-radius: 3px;
        margin: 3px;
    }

    label {
        font-weight: bold;
    }

    @font-face {
        font-family: 'huawen';
        src: url("/fonts/huawen.woff2");
    }
</style>

<body style="background-color: #F4F6FA; font-size: 13px;font-family:'huawen' ;font-weight: bold">
<div class="main-content" style="margin: 0;padding: 0;letter-spacing:2px;">
    <form id="form-user-add" th:object="${workFormBase}" class="form-horizontal" style="background-color: #F4F6FA">
        <input type="hidden" id="pkId" name="pkId" th:field="*{pkId}">
        <!--内右-->
        <div class="col-sm-12" style="border-left: 1px solid #ebebeb">
            <!--   工单基本信息     -->
            <div class="col-sm-12 " style="justify-content: space-between">
                <div class="tltieBoder">
                    <div class="blueBorder"></div>
                    <h4 style="margin:0 0 0 10px">工单基本信息</h4>
                </div>
            </div>
            <div class="form-group col-sm-12">
                <label class="col-xs-2 control-label entering-pd">来电内容：</label>
                <div class="col-xs-10">
                    <textarea name="fmContent" th:field="*{fmContent}" maxlength="3500"
                              class="form-control workRemark"
                              rows="3" style="height: 65px"></textarea>
                    <span class="tworkformprocess-span">还可以输入<i class="workRemarkI">3500</i>个文字</span>
                </div>
            </div>
            <div class="form-group col-sm-12">
                <div class="col-sm-6">
                    <label class="col-sm-4 control-label  entering-pd">来电类型：</label>
                    <div class="col-sm-8">
                        <select name="dfmClaNo" id="dfmClaNo" required
                                th:with="telTypes=${@commonServiceImpl.findTelType()}"
                                onchange="dropChgSendTextOnly(this,'dfmClaName');"
                                class="form-control formSelect">
                            <option value="">--请选择--</option>
                            <th:block th:each="item : ${telTypes}">
                                <option th:text="${item['CSText']}" th:value="${item['CSValue']}"
                                        th:selected="${item['CSValue'] eq workFormBase.dfmClaNo}"></option>
                            </th:block>
                        </select>
                        <input type="hidden" name="dfmClaName" id="dfmClaName" th:value="*{dfmClaName}"/>
                    </div>
                </div>
                <div class="col-sm-6">
                    <label class="col-sm-4 control-label entering-pd">内容类别：</label>
                    <div class="col-sm-8">
                        <input id="qxCT" th:value="*{dcntAname}" style="width:185px;height:31px;">
                        <input id="txtDcntAcode" name="dcntAcode" type="hidden" th:value="*{dcntAcode}"/>
                        <input id="txtDCntAName" name="dcntAname" type="hidden" th:value="*{dcntAname}"/>
                    </div>
                </div>
            </div>
            <!--工单主题-->
            <div class="form-group col-sm-12">
                <div class="col-sm-6">
                    <label class="col-sm-4 control-label entering-pd">工单主题：</label>
                    <div class="col-sm-8">
                        <input id="wsTopic" name="wsTopic" th:field="*{wsTopic}" placeholder="请输入"
                               class="form-control workTheme" type="text"
                               required="">
                    </div>
                </div>
                <div class="col-sm-6">
                    <label class="col-sm-4 control-label  entering-pd">拟办期限：</label>
                    <div class="col-sm-8">
                        <input name="wfLimit" id="wfLimit" th:field="*{wfLimit}" placeholder="请输入" class="form-control deadline"
                               type="text"
                               required="">
                    </div>
                    <div class="input-group-append " style="position: absolute;top: 10px;right: 40px;">
                        <span class="glyphicon glyphicon-calendar "></span>
                    </div>
                </div>
            </div>
            <div class="form-group col-sm-12">
                <div class="col-sm-6">
                    <label class="col-sm-4 control-label entering-pd">工单编号：</label>
                    <div class="col-sm-8">
                        <input name="workFormNo" th:field="*{workFormNo}" placeholder="请输入"
                               class="form-control workTheme" type="text"
                               disabled>
                    </div>
                </div>
                <div class="col-sm-6">
                    <label class="col-sm-4 control-label  entering-pd">工单性质：</label>
                    <div class="col-sm-8">
                        <select name="setProId" id="setProId" onchange="getSetProName()"
                                th:with="district=${@commonServiceImpl.findWorkFormType()}"
                                class="form-control formSelect">
                            <option value="">--请选择--</option>
                            <option th:each="item : ${district}" th:text="${item['CSText']}"
                                    th:value="${item['CSValue']}"
                                    th:selected="${item['CSValue']} == *{setProId}"></option>
                        </select>
                        <input id="setProName" type="hidden" name="setProName" th:value="*{setProName}"/>
                    </div>
                </div>
            </div>
            <div class="form-group col-sm-12">
                <div class="col-sm-6">
                    <label class="col-sm-4 control-label entering-pd" style="padding-top: 1px">建议公开：</label>
                    <div class="col-sm-8">
                        <input name="openX" th:checked="*{openX == 1}" th:value="*{openX}" type="checkbox"
                               data-size="small">
                    </div>
                </div>
                <div class="col-sm-6">
                    <label class="col-xs-4 control-label entering-pd" style="padding-top: 1px">是否督办：</label>
                    <div class="col-xs-8">
                        <input name="spareInt" th:checked="*{spareInt == 1}" th:value="*{spareInt}"
                               type="checkbox"
                               data-size="small">
                    </div>
                </div>
            </div>
            <div class="form-group col-sm-12">
                <div class="col-sm-6">
                    <label class="col-sm-4 control-label entering-pd" style="padding-top: 1px">是否紧急：</label>
                    <div class="col-sm-8">
                        <input name="mark" th:checked="*{mark == '1'}" th:value="*{mark}"
                               type="checkbox"
                               data-size="small">
                    </div>
                </div>
                <div class="col-sm-6">
                    <label class="col-xs-4 control-label entering-pd" style="padding-top: 1px">摘报：</label>
                    <div class="col-xs-8">
                        <input name="reportFlag" th:checked="*{reportFlag == 1}" th:value="*{reportFlag}"
                               type="checkbox"
                               data-size="small">
                    </div>
                </div>
            </div>

            <!-- 工单备注-->
            <div class="form-group col-sm-12">
                <label class="col-xs-2 control-label entering-pd">工单备注：</label>
                <div class="col-xs-10">
                    <textarea name="wfRemark" th:field="*{wfRemark}" maxlength="3500"
                                              class="form-control workRemark"
                                              rows="3" style="height: 65px"></textarea>
                    <span class="tworkformprocess-span">还可以输入<i class="workRemarkI">3500</i>个文字</span>
                </div>
            </div>
            <div class="form-group col-sm-12">
                <div class="col-sm-6">
                    <label class="col-sm-4 control-label entering-pd">创建人：</label>
                    <div class="col-sm-8">
                        <input name="iptWorker" th:field="*{iptWorker}" placeholder="请输入"
                               class="form-control workTheme" type="text"
                               disabled>
                        <input type="hidden" name="iptWorkNo" th:value="*{iptWorkNo}">
                    </div>
                </div>
                <div class="col-sm-6">
                    <label class="col-xs-4 control-label entering-pd">创建时间：</label>
                    <div class="col-xs-8">
                        <input name="crtStepTime" th:field="*{crtStepTime}" placeholder="请输入"
                               class="form-control workTheme" type="text"
                               disabled>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>

<script th:src="@{/ajax/libs/layui/laydate.js}"></script>
<th:block th:include="include :: footer"/>
<script th:src="@{/ajax/libs/bootstrap-tagsinput/tagsinput.min.js}"></script>
<script th:src="@{/ajax/libs/bootstrap-switch/bootstrap-switch.min.js}"></script>
<script th:src="@{/ajax/libs/jQuery-ui/jquery-ui.js}"></script>
<script th:src="@{/ajax/libs/qxEasyUI/jquery.easyui.min.js}"></script>
<!--<script th:src="@{/js/tworkformadd.js}"></script>-->
<script th:src="@{/js/telsendorder.js}"></script>
<!--<script th:src="@{/js/teladd.js}"></script>-->
<script>
    var prefix = ctx + "system/mTelWF";

    laydate.render({
        elem: '#wfLimit',
        type: 'datetime',
        trigger: 'click'
    });

    $('[name="openX"]').bootstrapSwitch({
        onText: "是",
        offText: "否",
        onColor: "success",
        offColor: "info",
        size: "mini",
        onSwitchChange: function (event, state) {
            if (state === true) {
                $(this).val(1);
            } else {
                $(this).val(0);
            }
        }
    });
    $('[name="reportFlag"]').bootstrapSwitch({
        onText: "是",
        offText: "否",
        onColor: "success",
        offColor: "info",
        size: "mini",
        onSwitchChange: function (event, state) {
            if (state === true) {
                $(this).val(1);
            } else {
                $(this).val(0);
            }
        }
    });
    $('[name="mark"]').bootstrapSwitch({
        offText: "否",
        onText: "是",
        onColor: "success",
        offColor: "info",
        size: "mini",
        onSwitchChange: function (event, state) {
            if (state === true) {
                $(this).val(1);
            } else {
                $(this).val(0);
            }
        }
    });
    $('[name="spareInt"]').bootstrapSwitch({
        onText: "是",
        offText: "否",
        onColor: "success",
        offColor: "info",
        size: "mini",
        onSwitchChange: function (event, state) {
            if (state === true) {
                $(this).val(1);
            } else {
                $(this).val(0);
            }
        }
    });

    $('#qxCT').combotree({
        url: '/system/common/findContentCate',
        required: false,
        onSelect: function (record) {
            $("#txtDcntAcode").val(record.id);
            $("#txtDCntAName").val(record.text);
            var dfmClaName = $("#dfmClaNo option:selected").text();
            var fromName = $("#fromName").val();
            $("#wsTopic").val(fromName + '[' + dfmClaName + ']' + record.text);
        }
    });


    $('#dfmClaNo').change(function () {
        var dfmClaName = $("#dfmClaNo option:selected").text();
        var txtDCntAName = $("#txtDCntAName").val();
        var fromName = $("#fromName").val();
        $("#wsTopic").val(fromName + '[' + dfmClaName + ']' + txtDCntAName);
    })

    function submitHandler() {
        if ($.validate.form()) {
            let data = $('#form-user-add').serializeArray();
            // $.operate.save(prefix + "/cmnFile/tWFormUpdateJson", data);
            $.ajax({
                url:prefix + "/cmnFile/tWFormUpdateJson",
                data:data,
                type:"post",
                contentType: "application/json",
                success:function (result) {
                    $.modal.msgSuccess("修改成功");
                    $.modal.close()
                }
            })
        }
    }
</script>
</body>
</html>

